<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>${info.title!} -- ${node.name} -- ${site.fullNameOrName}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description" content=""/>

    <link href="_files/css/base.css" type="text/css" rel="stylesheet"/>
    <script type="text/javascript" src="_files/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="_files/js/jquery.pin.min.js"></script>
    <script language="javascript" type="text/javascript" src="${fore}/bluewise.js"></script>
    <script language="javascript" type="text/javascript" src="${fore}/fore.js"></script>
    <script language="javascript" type="text/javascript" src="_files/pic_change.js"></script>
    <script language="javascript" type="text/javascript" src="_files/common.js"></script>
    <script language="javascript" type="text/javascript" src="_files/ckplayer.js" charset="utf-8"></script>
    <script type="text/javascript">
        $(function () {
            $("#nextone").click(function () {
                $("#auther").attr('src', '${ctx}/captcha.servlet?d=' + new Date() * 1);
                $("#captcha").unbind("focusin");
            });
            $("#captcha").focusin(function () {
                $(".autherimg").css("display", "inline");
                $("#auther").attr('src', '${ctx}/captcha.servlet?d=' + new Date() * 1);
            });
        });
    </script>
</head>
<body>
[#include "inc_header.html" /]
[#include "inc_focus.html"/]

<div class="dhnav">当前位置：<span class="col">会员礼品&nbsp;&gt;&nbsp;</span>正文</div>
<div class="main">
    <div class="l">
        <div class="box bgf">
            <h1>${info.fullTitleOrTitle}</h1>

            <div class="context">
                ${text}
                <table style="width: 100%;text-align: center; padding:10px;">
                    <tr>
                        <td colspan="4"><img src="${info.customs['bigImage']}"/><br/><br/></td>
                    </tr>
                    <tr>
                        <td height="40" align="left" width="20%">适用范围:</td>
                        <td width="30%" align="left">${info.customs['shiyongfanwei']}</td>
                        <td width="20%" align="left">材质:</td>
                        <td width="30%" align="left">${info.customs['caizhi']}</td>
                    </tr>
                    <tr>
                        <td height="40" align="left">尺寸</td>
                        <td align="left">${info.customs['chicun']}</td>
                        <td align="left">包装</td>
                        <td align="left">${info.customs['包装']}</td>
                    </tr>
                    <tr>
                        <td height="40" align="left">颜色</td>
                        <td align="left">${info.customs['yanse']}</td>
                        <td align="left">产品功能</td>
                        <td align="left">${info.customs['chanpingongneng']}</td>
                    </tr>
                    <tr>
                        <td height="40" align="left">所需积分</td>
                        <td align="left">${info.customs['score']}</td>
                        <td align="left"></td>
                        <td align="left"><a href="javascript:void(0);" onclick="checkApply()"> <img src="_files/images/exchange.png" width="70" height="25" alt=""/></a></td>
                    </tr>
                </table>
                <a name="ex"></a>
            </div>

            <div class="plcont" id="contractdiv" style="display: none">
                <h2>兑换--> 联系方式</h2>
                <form action="" name="formApply">
                    <input type="hidden" name="goodsId" value="${info.id}" />
                    <input type="hidden" name="goodsTitle" value="${info.fullTitleOrTitle}" />
                    <input type="hidden" name="goodsScore" value="${info.customs['score']}" />
                    <div class="plcon">
                        <div class="plconl">
                            联系人
                        </div>
                        <div class="plconr">
                            <input type="text" name="postuser" style="width: 200px;height: 30px;" />
                        </div>
                    </div>
                    <div class="plcon">
                        <div class="plconl">
                            联系电话
                        </div>
                        <div class="plconr">
                            <input type="text" name="telephone" style="width: 200px;height: 30px;" />
                        </div>
                    </div>
                    <div class="plcon">
                        <div class="plconl">
                            联系地址
                        </div>
                        <div class="plconr">
                            <textarea name="address" cols="50" rows="4"></textarea>
                            <a href="javascript:postApply()" class="plbtn">提交申请</a>
                        </div>
                    </div>
                </form>
            </div>

        </div>
    </div>
    <div class="r">
        [#include "inc_level2right.html"/]
    </div>
</div>
[#include "inc_fankui.html"/]
[#include "inc_footer.html"/]
<script type="text/javascript">
    function postApply() {
        [#if user??]
        [#if info.customs['score']?number > user.detail.score ]
        alert('您的积分不足以兑换本商品，您的剩余积分为${user.detail.score!}分');
        [#else]
        var form = $("form[name='formApply']");
        $.post("/my_goods_apply.jspx", form.serialize(), function (json) {
            alert(json.message);
        });
        [/#if]
        [#else]
        alert('请先登录');
        [/#if]
    }

    function checkApply() {
        [#if user??]
            [#if info.customs['score']?number > user.detail.score ]
            alert('您的积分不足以兑换本商品，您的剩余积分为${user.detail.score!}分');
            return false;
            [#else]
            $("#contractdiv").show();
            location.hash="ex";
            return true;
            [/#if]
        [#else]
            alert('请先登录');
            return false;
        [/#if]
    }
</script>
</body>
</html>

